package web

import (
	"gitee.com/xgotool/sqlite-logs-more/service/rootdb"
	"gitee.com/xiaoyutab/xgotool/xgin"
	"github.com/gin-gonic/gin"
)

// 获取设备详情信息
//
//	POST	dervice.info
func DerviceInfo(c *gin.Context) *xgin.Response {
	m := map[string]string{}
	if err := xgin.Bind(c, &m); err != nil {
		return xgin.Resp().Error(err)
	}
	// 获取设备详情信息
	der, err := rootdb.DerviceInfoByMac(m, c.ClientIP())
	if err != nil {
		return xgin.Resp().Error(err)
	}
	return xgin.Resp().SuccessAny(der)
}
